/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.webos.java.base.hsqldb.migration;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Kostya
 */
public class TableDefinition {
    private String name = "";
    private String type = null;
    private List<RowDefinition> rowDefinitions = new ArrayList<RowDefinition>();

    public TableDefinition(String aName) {
        setName(aName);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void addRow(RowDefinition aDefinition){
        aDefinition.setTable(this);
        rowDefinitions.add(aDefinition);
    }

    public int getRowCount(){
        return rowDefinitions.size();
    }

    public RowDefinition getRow(int aIndex){
        return rowDefinitions.get(aIndex);
    }

}
